package cn.dulian.spring5.service;

import cn.dulian.spring5.bean.Book;
import cn.dulian.spring5.dao.BookDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author dulian
 * @create 2022-04-15 22:35
 */
@Service
public class BookService {
    //注入dao
    @Autowired
    private BookDao bookDao;

    public void addBook(Book book){
        bookDao.add(book);
    }
    public void updateBook(Book book){
        bookDao.updateBook(book);
    }
    public void deleteBook(int id){
        bookDao.delete(id);
    }

    public void selectCount(){
        bookDao.selectCount();
    }

    public Book findBookInfo(int id){

        return bookDao.findBookInfo(id);
    }


}
